<?php 

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package     App_Backend
 * @subpackage  View
 * @author      Cheng Wei <berlios.o@gmail.com>
 * @version     $$Id: sliding.phtml 20 2010-12-18 09:35:07Z cheng.wei $$
 */

?>
<?php 
$curPath = $_SERVER["REQUEST_URI"];
$pathArr = explode('/page', $curPath);
$urlArr = explode('/index',$pathArr[0]);
$judgeArr = explode('/',$urlArr[0]);
if($judgeArr[count($judgeArr)-1]) {
	$str = '/index';
} else {
	$str = 'index';
}
$curUrl = $urlArr[0].$str;
?>
<?php if ($this->pageCount): ?> 
<div class="meta" style="width:600px;">
<ul style="padding-top:5px;">
            <li >
            <?php if ($this->pageCount > 1 && $this->current <> $this->pageCount): ?>
            	<a title="Last page" href="<?php echo $this->url(array('page' => $this->pageCount)); ?>" class="tooltip">
            	<span class="ui-icon ui-icon-arrowthickstop-1-e"></span>
            	<?php echo $this->__("last page") ?>
            	</a>
            <?php else: ?>
            	<a title="Last page" class="tooltip">
  				<span class="ui-icon ui-icon-arrowthickstop-1-e"></span>
            	<?php echo $this->__("last page") ?>
            	</a>
            <?php endif; ?>
            </li>
            <li >
            <?php if (isset($this->next)): ?>
   				<a title="Next page" href="<?php echo $this->url(array('page' => $this->next)); ?>" class="tooltip">
  				<span class="ui-icon ui-icon-arrowthick-1-e"></span>
            	<?php echo $this->__("next page") ?>
  				</a>
   			<?php else: ?>
   				<a title="Next page" class="tooltip">
  				<span class="ui-icon ui-icon-arrowthick-1-e"></span>
            	<?php echo $this->__("next page") ?>
            	</a>
  			<?php endif; ?>
            </li>
            <li >
            <?php if (isset($this->previous)): ?>
   				<a title="Previous page" href="<?php echo $this->url(array('page' => $this->previous)); ?>" class="tooltip">
  				<span class="ui-icon ui-icon-arrowthick-1-w"></span>
            	<?php echo $this->__("previous page") ?>
  				</a>
   			<?php else: ?>
   				<a title="Previous page" class="tooltip">
  				<span class="ui-icon ui-icon-arrowthick-1-w"></span>
            	<?php echo $this->__("previous page") ?>
            	</a>
  			<?php endif; ?>
  			</li>
         	<li >
         	<?php if ($this->current == 1): ?> 
         		<a title="First page"  class="tooltip">
            	<span class="ui-icon ui-icon-arrowthickstop-1-w"></span>
            	<?php echo $this->__("first page") ?>
            	</a>
         	<?php else: ?>
            	<a title="First page" href="<?php echo $this->url(array('page' => 1)); ?>" class="tooltip">
            	<span class="ui-icon ui-icon-arrowthickstop-1-w"></span>
            	<?php echo $this->__("first page") ?>
            	</a>
            <?php endif; ?>
            </li>
             
            
            
 </ul>

</div>
<div class="meta" style="clear:both;width:490px;margin-left:160px;margin-top:10px;">
<ul style="width:80px;">
	  	<li >
	  	<a onclick="goPage()" title="<?php echo $this->__("Submit") ?>"  class="tooltip">
	    <span class="ui-icon ui-icon-power"></span>
	    <?php echo $this->__("submit") ?>
	    </a>
	    </li>
	    </ul>
<div style="float:right;">
   		<?php echo $this->__("Page") ?>
   		<input style="width:30px;padding:0px;" type="text" class="input-text page" value="<?php echo $this->current ?>" name="curpage" id="curpage">				        
		<?php echo $this->__("of %d pages", $this->pageCount) ?><span class="separator">|</span>
  		<?php echo $this->__("View") ?>
	   <select onchange="changePerPage('<?php echo $this->url(array('PerPage' => '')) ?>'+this.value)" name="limit">
	   		<option <?php echo ($this->itemCountPerPage==10)?'selected="selected"':''?> value="10">10</option>		   	
	        <option <?php echo ($this->itemCountPerPage==20)?'selected="selected"':''?> value="20">20</option>
	        <option <?php echo ($this->itemCountPerPage==30)?'selected="selected"':''?> value="30">30</option>
	        <option <?php echo ($this->itemCountPerPage==50)?'selected="selected"':''?> value="50">50</option>
	        <option <?php echo ($this->itemCountPerPage==100)?'selected="selected"':''?> value="100">100</option>
	        <option <?php echo ($this->itemCountPerPage==200)?'selected="selected"':''?> value="200">200</option>
	   </select>		  
   	<?php echo $this->__("per page") ?><span class="separator">|</span>
   	
   	<?php echo $this->__("Total %d records found",$this->totalItemCount)?>
   	</div>
		
<?php endif; ?> 

</div>

<script type = "text/javascript">
function goPage()
{
	var page = $("#curpage").val();
	window.location.href = '<?php echo $curUrl; ?>/page/'+page;
}

function changePerPage(url) {
	window.location.href = url;
}
</script>